
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

const login = resolve => require(['@/components/view/login.vue'],resolve);  //登录
const allIndex = resolve => require(['@/components/MainIndex/allIndex.vue'],resolve);
//首页
const homePage = resolve => require(['@/components/page/home.vue'],resolve);
//商城
const shopPage = resolve => require(['@/components/page/shopPage.vue'],resolve);
//活动
const activityPage = resolve => require(['@/components/page/activityPage.vue'],resolve);
//消息
const messagePage = resolve => require(['@/components/page/messagePage.vue'],resolve);
//我的
const userPage = resolve => require(['@/components/page/userPage.vue'],resolve);
//列表
const goodsList = resolve => require(['@/components/detail/goodsList.vue'],resolve);
//课堂详情
const classDetail = resolve => require(['@/components/detail/classDetail.vue'],resolve);
//商城详情
const shopPageDetail = resolve => require(['@/components/detail/shopPageDetail.vue'],resolve);
//活动详情
const activeDetail = resolve => require(['@/components/detail/activeDetail.vue'],resolve);
//奖学金详情
const scholarshipDetail = resolve => require(['@/components/detail/scholarshipDetail.vue'],resolve);
//升级vip详情
const upgradeVIPDetail = resolve => require(['@/components/detail/upgradeVIPDetail.vue'],resolve);
//城市驿站详情
const cityPostDetail = resolve => require(['@/components/detail/cityPostDetail.vue'],resolve);
//我的积分详情
const integralDetail = resolve => require(['@/components/detail/integralDetail.vue'],resolve);
//我的助力详情
const powerDetail = resolve => require(['@/components/detail/powerDetail.vue'],resolve);
//我的优惠券详情
const couponsDetail = resolve => require(['@/components/detail/couponsDetail.vue'],resolve);
//我的优惠券详情
const orderList = resolve => require(['@/components/detail/orderList.vue'],resolve);
const  routerMaps=[
    // {name:'login',path:'/login',component:login,meta:{title:'登录'}},
    {name:'allIndex',path:'/allIndex',component:allIndex,children:[
        {name:'homePage',path:'/homePage',component:homePage,meta:{title:'首页'}},
        {name:'shopPage',path:'/shopPage',component:shopPage,meta:{title:'商城'}},
        {name:'activityPage',path:'/activityPage',component:activityPage,meta:{title:'活动'}},
        {name:'messagePage',path:'/messagePage',component:messagePage,meta:{title:'消息'}},
        {name:'userPage',path:'/userPage',component:userPage,meta:{title:'我的'}},
    ]},
    {name:'goodsList',path:'/goodsList',component:goodsList,meta:{title:''}},
    {name:'classDetail',path:'/classDetail',component:classDetail,meta:{title:'课堂详情'}},
    {name:'shopPageDetail',path:'/shopPageDetail',component:shopPageDetail,meta:{title:'商品详情'}},
    
    {name:'activeDetail',path:'/activeDetail',component:activeDetail,meta:{title:'活动详情'}},

    {name:'scholarshipDetail',path:'/scholarshipDetail',component:scholarshipDetail,meta:{title:'奖学金'}},
    {name:'upgradeVIPDetail',path:'/upgradeVIPDetail',component:upgradeVIPDetail,meta:{title:'升级VIP'}},
    {name:'cityPostDetail',path:'/cityPostDetail',component:cityPostDetail,meta:{title:'城市驿站'}},
    {name:'integralDetail',path:'/integralDetail',component:integralDetail,meta:{title:'我的积分'}},
    {name:'powerDetail',path:'/powerDetail',component:powerDetail,meta:{title:'我的助力'}},
    {name:'couponsDetail',path:'/couponsDetail',component:couponsDetail,meta:{title:'优惠券'}},
    {name:'orderList',path:'/orderList',component:orderList,meta:{title:'订单列表'}},
    {path: '*', redirect: '/homePage'}
];
const router=new Router({
  mode:'history',
  routes:routerMaps
});
export default router
